/**
 * 
 */
package it.unical.canonaco.rende.igpe.game.cbv.guilayer.sprites.key;

/**
 * @author Massimo Canonaco
 *
 */
public class PawnSheetKey extends AbstractSheetKey 
{
	/** */
	static private final char POINT = '.';
	
	/** */
	static public final String FRAME_TYPE_ANIMATIONS = "animations";
	
	/** */
	static public final String FRAME_TYPE_AVATAR = "avatar";
	
	/** */
	static public final String FRAME_POINT_YOUR_FRONT = "myfront";
	
	/** */
	static public final String FRAME_POINT_YOUR_BACK = "myback";
	
	/** */
	static public final String FRAME_POINT_ENEMY_FRONT = "hisfront";
	
	/** */
	static public final String FRAME_POINT_ENEMY_BACK = "hisback";
	
	/** */
	private String who;
	
	/** */
	private String what;
	
	/** */
	private String when;
	
	@Override
	public String getKey() 
	{
		StringBuffer string = new StringBuffer(who.length()+what.length()+when.length()+2);
		string.append(who).append(POINT).append(what).append(POINT).append(when);
		
		return string.toString();
	}

	/**
	 * @return the who
	 */
	public String getWho() {
		return who;
	}

	/**
	 * @param who the who to set
	 */
	public void setWho(String who) {
		this.who = who;
	}

	/**
	 * @return the what
	 */
	public String getWhat() {
		return what;
	}

	/**
	 * @param what the what to set
	 */
	public void setWhat(String what) {
		this.what = what;
	}

	/**
	 * @return the when
	 */
	public String getWhen() {
		return when;
	}

	/**
	 * @param when the when to set
	 */
	public void setWhen(String when) {
		this.when = when;
	}

	@Override
	public AbstractSheetKey getCopy() {
		PawnSheetKey psk = new PawnSheetKey();
		psk.setWho(new String(who));
		psk.setWhat(new String(what));
		psk.setWhen(new String(when));
		psk.setFrameKey(getFrameKey().getCopy());
		
		return psk;
	}
}
